var express = require('express');
var router = express.Router();

// 获取Theater中暴露的方法
const {addTheater , getTheater,deleteTheater,updateTheater} = require('../controllers/TheaterControllers')

router.post('/addTheater', async function (req, res, next){

    const params = req.body;
   
    const result = await addTheater(params)
    res.send(result)
})

router.get('/getTheater',async function ( req ,res ,next){

    const data = await getTheater()
    res.send(data)
})

router.post('/deleteTheater', async function(req ,res ,next){
  
    const params  =  req.body;
    const data = await deleteTheater(params)
    res.send(data)
})

// router.post('/updateTheater', async function (req, res , next){
//     const params = req.body;
//    const data = await updateTheater(params)
//    res.send(data)
// })












module.exports = router;